<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
if (window.internals)
  internals.settings.setEditingBehavior('win');

selection_test(
  '<div contenteditable dir="ltr">|    אבצ    דעפ    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    |אבצ    דעפ    חיח    ופק    </div>',
  '6-0 left word');

selection_test(
  '<div contenteditable dir="ltr"> |   אבצ    דעפ    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    |אבצ    דעפ    חיח    ופק    </div>',
  '6-1 left word');

selection_test(
  '<div contenteditable dir="ltr">  |  אבצ    דעפ    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    |אבצ    דעפ    חיח    ופק    </div>',
  '6-2 left word');

selection_test(
  '<div contenteditable dir="ltr">   | אבצ    דעפ    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    |אבצ    דעפ    חיח    ופק    </div>',
  '6-3 left word');

selection_test(
  '<div contenteditable dir="ltr">    |אבצ    דעפ    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    |אבצ    דעפ    חיח    ופק    </div>',
  '6-4 left word');

selection_test(
  '<div contenteditable dir="ltr">    א|בצ    דעפ    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    |\u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-5 left word');

selection_test(
  '<div contenteditable dir="ltr">    אב|צ    דעפ    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    |\u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-6 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ|    דעפ    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    |\u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-7 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ |   דעפ    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    |\u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-8 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ  |  דעפ    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    |\u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-9 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ   | דעפ    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    |\u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-10 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    |דעפ    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    |\u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-11 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    ד|עפ    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-12 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דע|פ    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-13 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ|    חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-14 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ |   חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-15 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ  |  חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-16 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ   | חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-17 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    |חיח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-18 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    ח|יח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4 |   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-19 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    חי|ח    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4 |   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-20 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    חיח|    ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4 |   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-21 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    חיח |   ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4 |   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-22 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    חיח  |  ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4 |   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-23 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    חיח   | ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4 |   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-24 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    חיח    |ופק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4 |   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '6-25 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    חיח    ו|פק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7 |   \u05D5\u05E4\u05E7    </div>',
  '6-26 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    חיח    ופ|ק    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7 |   \u05D5\u05E4\u05E7    </div>',
  '6-27 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    חיח    ופק|    </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7 |   \u05D5\u05E4\u05E7    </div>',
  '6-28 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    חיח    ופק |   </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7 |   \u05D5\u05E4\u05E7    </div>',
  '6-29 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    חיח    ופק  |  </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7 |   \u05D5\u05E4\u05E7    </div>',
  '6-30 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    חיח    ופק   | </div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7 |   \u05D5\u05E4\u05E7    </div>',
  '6-31 left word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    חיח    ופק    |</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    \u05D7\u05D9\u05D7 |   \u05D5\u05E4\u05E7    </div>',
  '6-32 left word');
</script>
